package top

object DefaultSettings {
  def apply() = Map(
    "MemMapBase" -> 0x0000000000000000L,
    "MemMapRegionBits" -> 0,
    "MMIOBase" -> 0x0000000010000000L,
    "MMIOSize" -> 0x0000000040000000L,
    "ResetVector" -> 0x80000000L,

    "MmodeOnly" -> false,
    "IsRV32" -> false,
    "FPGAPlatform" -> false,
    "HasRVM"  -> true,
  )
}

object YsyxSettings {
  def apply() = Map(
    "FPGAPlatform" -> true,
    "MMIOBase" -> 0x0000000010000000L,
    "MMIOSize" -> 0x0000000040000000L,
    "ResetVector" -> 0x30000000L,
    "HasRVM"  -> false,
  )
}

object Settings {
  var settings: Map[String, AnyVal] = DefaultSettings()
  def get(field: String) = {
    settings(field).asInstanceOf[Boolean]
  }
  def getLong(field: String) = {
    settings(field).asInstanceOf[Long]
  }
  def getInt(field: String) = {
    settings(field).asInstanceOf[Int]
  }
}